package www.nfin.ya.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class SqlTemplate {
    @Excel(name = "节点")
    private int nodeId;
    @Excel(name = "主节点")
    private int parentNode;
    @Excel(name = "sheetName")
    private String parentNodeName;
    @Excel(name = "模板名")
    private String name;
    @Excel(name = "描述")
    private String msg;
    @Excel(name = "执行体")
    private String body;

    @Override
    public String toString() {
        return "SqlTemplate{" +
                ", name='" + name + '\'' +
                ", msg='" + msg + '\'' +
                '}';
    }
    public List<String> getBodyDetailed(){
        String[] split = body.split(";");
        List<String> detail = Arrays.stream(split).filter(e -> {
            if(e == null || e.length() < 10){
                return false;
            }else
                return true;
        }).collect(Collectors.toList());
        return detail;
    }

    public static void main(String[] args) {
        String s = "swefwef;";
        String[] split = s.split(";");

        List<String> strings = Arrays.asList(split.clone());
        System.out.println("s");
    }

}
